package com.ming.springcloud.user.controller;

import com.ming.springcloud.user.api.util.ResponseEntity;
import com.ming.springcloud.user.pojo.User;
import com.ming.springcloud.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @RequestMapping("/login")
    public ResponseEntity findDataGroupById(@RequestBody User user) {
       String userAccount = user.getUserAccount();
        String userPassword = user.getUserPassword();
        int Result = 0;
        boolean isT = this.userService.findServerByNameLike(userAccount,userPassword);
        if (isT){
            Result = 1;
        }
        return ResponseEntity.success(Result);
    }

}
